<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>js函数定义的几种方式</title>
	</head>
	<body>
		<script type="text/javascript">
			function f1(s) {
				alert(s);
			}

			var f2 = function(s) {
				alert(s);
			}

			var f3 = new Function("s", "alert(s);");

			var f4 = s => {
				alert(s);
			}
			
			f1("方法1");
			f2("方法2");
			f3("方法3");
			f4("方法4");
		</script>
	</body>
</html>
